package com.ysd.servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ysd.dao.impl.CaseDao;
import com.ysd.entity.Case;
import com.ysd.util.BaseServlet;


@WebServlet("/CaseServlet")
public class CaseServlet extends BaseServlet {
	CaseDao dao=new CaseDao();
	public void one(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		ArrayList<Case> ProductType=dao.getAllProductType();
		ArrayList<Case> picture=dao.getAllpicture();
		Case product=dao.getAllXiangQing();
		request.setAttribute("ProductType", ProductType);
		request.setAttribute("product", product);
		request.setAttribute("picture", picture);
		request.getRequestDispatcher("/productlist.jsp").forward(request, response);
	}
	public void oneXiangQing(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		ArrayList<Case> ProductType=dao.getAllProductType();
		ArrayList<Case> picture=dao.getAllpicture();
		Case product=dao.getAllXiangQing();
		request.setAttribute("ProductType", ProductType);
		request.setAttribute("product", product);
		request.setAttribute("picture", picture);
		request.getRequestDispatcher("/productdetails.jsp").forward(request, response);
	}
	public void two(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		ArrayList<Case> ProductType=dao.getAllProductType();
		Case product=dao.getAllXiangQingTwo();
		ArrayList<Case> picture=dao.getAllpictureTwo();
		request.setAttribute("ProductType", ProductType);
		request.setAttribute("product", product);
		request.setAttribute("picture", picture);
		request.getRequestDispatcher("/productfashion.jsp").forward(request, response);
	}
	public void TwoXiangQing(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		ArrayList<Case> ProductType=dao.getAllProductType();
		Case product=dao.getAllXiangQingTwo();
		ArrayList<Case> picture=dao.getAllpictureTwo();
		request.setAttribute("ProductType", ProductType);
		request.setAttribute("product", product);
		request.setAttribute("picture", picture);
		request.getRequestDispatcher("/productdetails_fashion.jsp").forward(request, response);
	}
	public void three(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		ArrayList<Case> ProductType=dao.getAllProductType();
		Case product=dao.getAllXiangQingThree();
		ArrayList<Case> picture=dao.getAllpictureThree();
		request.setAttribute("ProductType", ProductType);
		request.setAttribute("product", product);
		request.setAttribute("picture", picture);
		request.getRequestDispatcher("/producttreasure_up.jsp").forward(request, response);
	}
	public void ThreeXiangQing(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		ArrayList<Case> ProductType=dao.getAllProductType();
		Case product=dao.getAllXiangQingThree();
		ArrayList<Case> picture=dao.getAllpictureThree();
		request.setAttribute("ProductType", ProductType);
		request.setAttribute("product", product);
		request.setAttribute("picture", picture);
		request.getRequestDispatcher("/productdetails_treasure_up.jsp").forward(request, response);
	}
	public void four(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		ArrayList<Case> ProductType=dao.getAllProductType();
		Case product=dao.getAllXiangQingFour();
		ArrayList<Case> picture=dao.getAllpictureFour();
		request.setAttribute("ProductType", ProductType);
		request.setAttribute("product", product);
		request.setAttribute("picture", picture);
		request.getRequestDispatcher("/producttide.jsp").forward(request, response);
	}
	public void FourXiangQing(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		ArrayList<Case> ProductType=dao.getAllProductType();
		Case product=dao.getAllXiangQingFour();
		ArrayList<Case> picture=dao.getAllpictureFour();
		request.setAttribute("ProductType", ProductType);
		request.setAttribute("product", product);
		request.setAttribute("picture", picture);
		request.getRequestDispatcher("/productdetails_tide.jsp").forward(request, response);
	}
}
